<template>
  <div class="header">
    <div class="header-left">
      <div class="iconfont back-icon" @click="boom">&#xe624;</div>
    </div>
    <router-link
      to="/scenic"
      tag="div"
      class="header-input">
          <span class="iconfont">&#xe632;</span>
          输入城市/景点/游玩主题
    </router-link>
    <router-link to='/city'>
      <div class="header-right">
        {{this.$store.state.city}}
        <span class="iconfont arrow-icon">&#xe64a;</span>
      </div>
    </router-link>
  </div>

</template>

<script>
  export default {
    name: 'HomeHeader1',
    data () {
      return{
        jokes:["不要点了哦！等下我爆炸给你看",
              "想干嘛，这里是不能点的",
              "别点了，人家不喜欢你",
              "武林禁地，凡夫俗子不得入内",
              "呀呀呀，别点..好疼的..呜呜",
              "还来？等下送你一首雷军的are You Ok喽",
              "亲亲我，抱抱我，举高高",
              "咦，我妈妈不让我跟你玩",
              "你吃泡面吗？只跟吃泡面的人做朋友，哼(︶︹︺)",
              "di..警告！此地非绝顶之人拒绝入内"
        ]
      }
    },
    methods: {
      boom () {
        const num = Math.floor(Math.random()*10);
        alert(this.jokes[num])
      }
    }
  }
</script>

<style  scoped>
  .header {
    display: flex;
    line-height: 64px;
    background-color: green;
    color: #fff;
    width: 100%;
    position: fixed;
    z-index: 2;

  }

  .header-left{
    width: 32px;
    float: left;
  }
  .back-icon{
    text-align: center;
    font-size: 20px;
  }
  .header-input {
    flex: 1;
    height: 32px;
    line-height: 32px;
    margin-top: 18px;
    margin-left: 10px;
    padding-left: 10px;
    background: #fff;
    border-radius: 5px;
    color: #ccc;
  }

  .header-right {
    min-width: 52px;
    padding: 5px;
    float: right;
    text-align: center;
    color: #fff
  }
  .arrow-icon {
    margin-left: 2px;
    font-size: 12px;
  }

</style>





